<template>
  <div>
    <!--头部-->
    <header class="publicHeader">
      <h1>超市订单管理系统</h1>
      <div class="publicHeaderR">
        <p><span>下午好！</span><span style="color: #fff21b"> 系统管理员</span> , 欢迎你！</p>
        <a href="jsp/logout.do">退出</a>
      </div>
    </header>
    <!--时间-->
    <section class="publicTime">
      <span id="time">2015年1月1日 11:11  星期一</span>
      <a href="#">温馨提示：为了能正常浏览，请使用高版本浏览器！（IE10+）</a>
    </section>
    <!--主体内容-->
    <section class="publicMian ">
      <div class="left">
        <h2 class="leftH2"><span class="span1"></span>功能列表 <span></span></h2>
        <nav>
          <ul class="list">
            <li><a href="jsp/bill.do?method=query">订单管理</a></li>
            <li><a href="#/providerManager">供应商管理</a></li>
            <li><a href="#/userManager">用户管理</a></li>
            <li><a href="jsp/pwdmodify.jsp">密码修改</a></li>
            <li><a href="jsp/logout.do">退出系统</a></li>
          </ul>
        </nav>
      </div>
      <div class="right">
        <div class="location">
          <strong>你现在所在的位置是:</strong>
          <span>供应商管理页面 >> 信息查看</span>
        </div>
        <div class="providerView">
          <p><strong>供应商编码：</strong><span>{{provider.proCode}}</span></p>
          <p><strong>供应商名称：</strong><span>{{provider.proName}}</span></p>
          <p><strong>联系人：</strong><span>{{provider.proContact}}</span></p>
          <p><strong>联系电话：</strong><span>{{provider.proPhone}}</span></p>
          <p><strong>传真：</strong><span>{{provider.proFax}}</span></p>
          <p><strong>描述：</strong><span>{{provider.proDesc}}</span></p>
          <div class="providerAddBtn">
            <input type="button" id="back" name="back" value="返回" @click="backToProvider">
          </div>
        </div>
      </div>
    </section>


    <footer class="footer">
      版权归关老师
    </footer>
  </div>
</template>

<script>

import axios from "axios";

export default {
  name: "ProviderShow",
  data() {
    return {
      id: 0,
      provider: {}
    }
  },
  created() {
    this.id = this.$route.query.id
    this.loadProviderById()
  },
  methods: {
    loadProviderById() {
      let _this = this;
      console.log(this.id)
      axios.get('/api/smbms-provider/provider/id/' + this.id)
          .then((response) => {
            console.log(response.data.data)
            _this.provider = response.data.data
          })
    }
  }
}
</script>

<style lang="css">
/*引入外部css文件*/
@import url('../assets/css/style.css');
@import url('../assets/css/public.css');
</style>